using GLib;

[CCode (lower_case_cprefix = "", cheader_filename = "libtcc.h")]
namespace TinyC
{
    [CCode (cname = "int", cprefix = "TCC_OUTPUT_", has_type_id = "false")]
    public enum OutPutType
    {
        MEMORY,
        EXE,
        DLL,
        OBJ,
        PREPROCESS
    }

    [CCode (cname = "TCCState", free_function = "tcc_delete", has_type_id = "false")]
    [Compact]
    public class Tcc {
        [CCode (cname = "tcc_new", has_type_id = "false")]
        public Tcc();
        [CCode (cname = "tcc_set_lib_path", has_type_id = "false")]
        public void set_lib_path(string path);
        [CCode (cname = "tcc_set_options", has_type_id = "false")]
        public int set_options(string @string);
        [CCode (cname = "tcc_add_include_path", has_type_id = "false")]
        public int add_include_path(string path);
        [CCode (cname = "tcc_add_sysinclude_path", has_type_id = "false")]
        public int add_sysinclude_path(string path);
        [CCode (cname = "tcc_define_symbol", has_type_id = "false")]
        public int define_symbol(string symbol, string @value);
        [CCode (cname = "tcc_undefine_symbol", has_type_id = "false")]
        public int undefine_symbol(string symbol);
        [CCode (cname = "tcc_add_file", has_type_id = "false")]
        public int add_file(string filename);
        [CCode (cname = "tcc_compile_string", has_type_id = "false")]
        public int compile_string(string @string);
        [CCode (cname = "tcc_set_output_type", has_type_id = "false")]
        public int set_output_type(OutPutType type);
        [CCode (cname = "tcc_add_library_path", has_type_id = "false")]
        public int add_library_path(string path);
        [CCode (cname = "tcc_add_library", has_type_id = "false")]
        public int add_library(string library);
        [CCode (cname = "tcc_add_symbol", has_type_id = "false")]
        public int add_symbol(string name, void *@value);
        [CCode (cname = "tcc_get_symbol", has_type_id = "false")]
        public void* get_symbol(string name);
        [CCode (cname = "tcc_output_file", has_type_id = "false")]
        public int output_file(string filename);
        [CCode (cname = "tcc_run", has_type_id = "false")]
        public int run(int argc, string[] argv);
        [CCode (cname = "tcc_relocate", has_type_id = "false")]
        public int relocate(void *ptr = (void *)1);
    }
}
